$(function(){
	$("#addForm").validate({
		rules: {
			companyId: 'required',
			navigateId: 'required',
            title: 'required'
		},
		messages: {
			companyId: {
				required: "请选择公司"
			},
			navigateId: {
				required: "请选择企业导航"
			},
			title: {
				required: "请输入标题"
			}
		}
	});
});

function getNavigations(companyId){
	var navigate = $("#navigate");
	navigate.empty(); 
	if(companyId!=""){
		$.ajax({
			type:"post",
			url:"/introduction/getNavsByCompany",
			data:{
				"companyId":companyId
			},
			success:function(data){
				$.each(data,function(i,item){
					navigate.append("<option value="+item.id+">"+item.navName+"</option>");
				});
			}
		});
	}
}